<template>
	<div class="goods_two">
		<div class="goods"
			id="goods"
		>
			<ul class="goods-items">
				<li class="goods-item"
					v-for="(goods, index) in goodsList"
					@click="goDetail(goods)"
				>
					<div class="goods-item-img">
						<img v-lazy="goods.goods_img" 
							:key="goods.goods_img"
						/>
					</div>
					<p class="title one-line"><span class="TBimg" v-if="goods.is_tmall == 0 && type == 1"></span><span class="TMimg" v-if="goods.is_tmall == 1 && type == 1"></span><span class="PDDimg" v-if="type == 2"></span>{{goods.goods_title}}</p>
					<div class="sale">
						<p class="oldprice">原价￥<span>{{goods.goods_price}}</span></p>
						<p>{{goods.sales_num}}人已买</p>
					</div>
					<div class="price">
						<i class="icon" :style="{backgroundImage: 'linear-gradient(to right, rgb(79, 92, 104), rgb(42, 62, 69))',background: 'linear-gradient(to right,' + colorLeft + ',' + colorRight + ')'}">券后价</i>
						<p class="coupon-price common-color">￥<span>{{goods.goods_money}}</span></p>
						<div class="gr-price-right" :style="{backgroundImage: 'linear-gradient(to right, rgb(79, 92, 104), rgb(42, 62, 69))',background: 'linear-gradient(to right,' + colorLeft + ',' + colorRight + ')'}">
							{{goods.coupon_price}}元券
							<div class="dotl"></div>
							<div class="dotr"></div>
						</div>
					</div>
				</li>
			</ul>
		</div>
	</div>
</template>
<script>
	import { Toast } from 'mint-ui'
	import axios from 'axios'
	import Http from '../http.js'
	export default{
		props: {
			goodsList: {
				type: Array
			},
			proType: {
				type: String
			}
		},
		data(){
			return{
				type: this.proType,
				colorLeft: window.localStorage.getItem("left"), 
				colorRight: window.localStorage.getItem("right"), 
				colorMid: window.localStorage.getItem("mid"), 
				token: window.localStorage.getItem("token")
			}
		},
		mounted(){

		},
		methods: {
			goDetail: function(goods){
				this.$router.push({
					path: '/product/detail/' + goods.goods_id,
					query: {
                        type: goods.type,
                        is_collect: goods.is_collect,
                        image: goods.goods_img,
                        title: goods.goods_title,
                        coupon_price: goods.goods_money,
                        origin_price: goods.goods_price,
                        quan_price: goods.coupon_price,
                        quan_time: goods.coupon_end_time,
					}
				})
			},
		}
	}
</script>
<style lang="scss" scoped>
	.goods_two{
		@import '../assets/common/goods_two.scss'
	}
</style>